home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
551-575
/
disk_559
/
apig
/
apiglib_v11.lzh
/
e15_borders.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1991-09-28
|
3KB
|
90 lines
/* example of using linked borders */
/* */
x = addlib("apig.library",0,-30,0)
portname = "example15_port"
p = openport(portname)
call set_apig_globals()
scrtitle = " This is Your New Screen !"
wintitle = " This is your Window Title"
winidcmp = CLOSEWINDOW
winflags = WINDOWCLOSE+WINDOWDRAG+WINDOWSIZING+WINDOWDEPTH+GIMMEZEROZERO
scr = openscreen(0,0,640,400,3,4,5,LACE+HIRES,CUSTOMSCREEN,scrtitle)
/* open window */
w1 = openwindow(portname,0,0,640,400,2,4,winidcmp,winflags,wintitle,scr,0,0,0)
/* get windows rastport for drawing */
rpw1 = getwindowrastport(w1)
/* create and initialize array of XY points for border */
barray = allocmem(20,MEMF_CLEAR) /* need 20 bytes, 5points * 2x * 2y */
x = setx(barray,0,0) ; y = sety(barray,0,0)
x = setx(barray,1,150) ; y = sety(barray,1,0)
x = setx(barray,2,150) ; y = sety(barray,2,100)
x = setx(barray,3,0) ; y = sety(barray,3,100)
x = setx(barray,4,0) ; y = sety(barray,4,0)
border2 = makeborder(w1,barray,5,0,10,2,0,JAM2,0)
border3 = makeborder(w1,barray,5,10,20,3,0,JAM2,border2)
border4 = makeborder(w1,barray,5,20,30,4,0,JAM2,border2)
border5 = makeborder(w1,barray,5,30,40,5,0,JAM2,border2)
border6 = makeborder(w1,barray,5,40,50,6,0,JAM2,border2)
border7 = makeborder(w1,barray,5,50,60,7,0,JAM2,border2)
border8 = makeborder(w1,barray,5,60,70,1,0,JAM2,border2)
border9 = makeborder(w1,barray,5,70,80,2,0,JAM2,border2)
border10 = makeborder(w1,barray,5,80,90,3,0,JAM2,border2)
border11 = makeborder(w1,barray,5,90,100,4,0,JAM2,border2)
z = drawborder(rpw1,border2,0,22)
z = pitext(rpw1,40,230," These borders have been linked ",1,2,JAM2,0)
z = pitext(rpw1,350,40," These are AUTO Borders ",1,2,JAM2,0)
/* create an AUTO BORDER */
/* In the makeborder call below, the barray pointer is 0, */
/* thus border array will be generated for you */
/* border thickness = 5, width of the border = 20, height = 60, */
border1 = makeborder(w1,0,5,20,60,1,0,JAM2,0)
z = drawborder(rpw1,border1,300,52)
/* do some more ... */
border1 = makeborder(w1,0,15,160,60,1,0,JAM2,0) /* thickness = 15 */
z = drawborder(rpw1,border1,350,80)
border1 = makeborder(w1,0,8,160,60,2,0,JAM2,0) /* thickness = 8 */
z = drawborder(rpw1,border1,350,180)
border1 = makeborder(w1,0,3,160,60,3,0,JAM2,0) /* thickness = 3 */
z = drawborder(rpw1,border1,350,280)
z = pitext(rpw1,300,370," DONE ",1,2,JAM2,0)
do forever /* IDCMP loop, wait for CLOSEWINDOW message */
x = waitpkt(portname)
do forever
msg = '0000 0000'x
msg = getpkt(portname)
if msg = '0000 0000'x then leave
class = getarg(msg,0)
if class = CLOSEWINDOW then exitme = 1
x = reply(msg,0)
end
if exitme = 1 then leave
end
z = freemem(barray,20)
z = closewindow(w1)
z = closescreen(scr)
exit